﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using MINERP.DAL;
using MINERP.DAL.Statistics;
using MINERP.MODEL.FoundationModel;

namespace MINERP.BLL.Statistics.NM
{
    public class NMShopPruductPriceBll
    {
        public List<Shop_Info> GetShopBySimpleCode(string inStrCode)
        {
            List<Shop_Info> shopList=new List<Shop_Info>();
            using (newSampleYPDBEntities db=new newSampleYPDBEntities())
            {
                List<Shop> listShop = db.Shop.Where(p => p.mnemonicCode.Contains(inStrCode)).ToList();
                foreach (Shop list in listShop)
                {
                    shopList.Add(new Shop_Info(){ShopId = list.ShopId,ShopName = list.shopName});

                }
            }
            return shopList.OrderBy(p=>p.ShopName).ToList();
        }

        public DataSet GetProductPriceDetail(int inShopId,DateTime inStartTime,DateTime inEndTime)
        {
            return NMShopPruductPriceDAL.GetData(inShopId, inStartTime, inEndTime);
        }
        public DataSet GetProductPriceDetailForFuji(int inShopId, DateTime inStartTime, DateTime inEndTime)
        {
            return NMShopPruductPriceDAL.GetDataForFuji(inShopId, inStartTime, inEndTime);
        }
        public DataSet GetProductInfo(DateTime inStartTime, DateTime inEndTime)
        {
            return NMShopPruductPriceDAL.GetPruductInfo(inStartTime, inEndTime);
        }
    }
}
